package com.baomidou.ant.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


/**
 *@description:   姓名校验
 *@author:        zhoubeibei
 *@email:         2315544970@qq.com
 *@date:          2021/6/10
 *@time:          10:26
 */
public class CheckNameUtils {
    public static boolean checkNameValid(String passengerName) {
        //姓名中可包含汉字，且两位以上
        String RULE = "([\u4e00-\u9fa5]{2,})";
        Pattern pattern = Pattern.compile(RULE);
        Matcher matcher = pattern.matcher(passengerName);
        return matcher.matches();
    }
}
